<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>个人信息</title>
		<link rel="stylesheet" href="../../../static/bootstrap-3.3.7/css/bootstrap.min.css">
		<link rel="stylesheet" href="../../../static/css/offerChainTool.css">
	</head>

	<body>
		<div class="container-fluid backContainer">
			<h3>个人信息<small class="text-muted">（未设置）</small><small class="text-primary">（审核中）</small><small class="text-danger">（未通过）</small><small class="text-warning">（审核通过）</small></h3>

			<form class="form-horizontal">
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-1 control-label"><span class="inputRequired">*</span>头像设置</label>
					<div class="col-sm-5 imgupload">
						<div id="uploader-demo">
							<!--用来存放item-->
							<div id="fileList" class="uploader-list"></div>
							<div id="filePicker">选择图片</div>
						</div>
					</div>

				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-1 control-label"><span class="inputRequired">*</span>账户名称</label>
					<div class="col-sm-4">
						<input type="text" class="form-control" id="uesrname" placeholder="该账户名称设置后不可更改">
					</div>
					<div clas s="col-sm-3 inputPrompt">
						<small class="text-danger" data-container="body" data-toggle="popover" data-placement="right" data-content="1.京东联盟id账号错误">（未通过）</small>
					</div>
				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-1 control-label"><span class="inputRequired">*</span>账户类型</label>
					<div class="col-sm-4">
						<label class="radio-inline">
					  <input type="radio" name="inlineRadioOptions" id="inlineRadio1"  checked="checked" value="jdts"> 京东推手
					</label>
						<label class="radio-inline">
					  <input type="radio" name="inlineRadioOptions" id="inlineRadio2"  value="zstd"> 招商团队
					</label>
						<label class="radio-inline">
					  <input type="radio" name="inlineRadioOptions" id="inlineRadio3"  value="jdsj"> 京东商家
					</label>
					</div>
					<div class="col-sm-3 inputPrompt">
						<small class="text-danger">（未通过）</small>
					</div>
				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-1 control-label">团队名称</label>
					<div class="col-sm-4">
						<input type="text" class="form-control" id="teamname" placeholder="请设置您的团队名称">
					</div>
					<div class="col-sm-3 inputPrompt">
						<small class="text-danger">（未通过）</small>
					</div>
				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-1 control-label"><span class="inputRequired">*</span>京东联盟ID</label>
					<div class="col-sm-4">
						<input type="text" class="form-control" id="jdtext" placeholder="请输入您的京东联盟ID">
					</div>
				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-1 control-label"><span class="inputRequired">*</span>推广位ID</label>
					<div class="col-sm-4">
						<input type="text" class="form-control" id="protext" placeholder="请输入您的推广位ID">
					</div>
				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-1 control-label"><span class="inputRequired">*</span>QQ账号</label>
					<div class="col-sm-4">
						<input type="text" class="form-control" id="qqtext" placeholder="请输入您的QQ账号">
					</div>
					<div class="col-sm-3 inputPrompt">
						<small class="text-danger">（未通过）</small>
					</div>
				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-1 control-label">团队介绍</label>
					<div class="col-sm-5">
						<textarea class="form-control" rows="5" id="teamtext" placeholder="请简单介绍您的团队"></textarea>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-1">
						<button type="button" class="btn btn-default ddt-btn from-btn" id="submitBut" style="width: 100%;background: #FF2040;">提交审核</button>
					</div>
				</div>
			</form>

		</div>
		<script src="../../../static/js/jquery.js" type="text/javascript"></script>
		<script src="../../../static/dist/webuploader.js" type="text/javascript"></script>
		<script src="../../../static/js/config.js" type="text/javascript"></script>
		<script src="../../../static/js/perinfo.js" type="text/javascript"></script>

		<script>
			var img;
			// 图片上传demo
jQuery(function() {
    var $ = jQuery,
        $list = $('#fileList'),
        // 优化retina, 在retina下这个值是2
        ratio = window.devicePixelRatio || 1,

        // 缩略图大小
        thumbnailWidth = 100 * ratio,
        thumbnailHeight = 100 * ratio,

        // Web Uploader实例
        uploader;

    // 初始化Web Uploader
    uploader = WebUploader.create({

        // 自动上传。
        auto: true,

        // swf文件路径
        swf:  '/js/Uploader.swf',

        // 文件接收服务端。
        server: 'http://file.jhjvip.cn:8888/image-server/uploadImage/oss',

        // 选择文件的按钮。可选。
        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
        pick: '#filePicker',

        // 只允许选择文件，可选。
        accept: {
            title: 'Images',
            extensions: 'gif,jpg,jpeg,bmp,png',
            mimeTypes: 'image/*'
        }
    });

    // 当有文件添加进来的时候
    uploader.on( 'fileQueued', function( file ) {
    	console.log(file)
        var $li = $(
                '<div id="imgurl" class="file-item thumbnail">' +
                    '<img>' +
                    
                '</div>'
                ),
            $img = $li.find('img');

        $list.html( $li );

        // 创建缩略图
        uploader.makeThumb( file, function( error, src ) {
            if ( error ) {
                $img.replaceWith('<span>不能预览</span>');
                return;
            }
			console.log(src);
            $img.attr( 'src', src );
        }, thumbnailWidth, thumbnailHeight );
    });

    // 文件上传过程中创建进度条实时显示。
    uploader.on( 'uploadProgress', function( file, percentage ) {
        var $li = $( '#'+file.id ),
            $percent = $li.find('.progress span');

        // 避免重复创建
        if ( !$percent.length ) {
            $percent = $('<p class="progress"><span></span></p>')
                    .appendTo( $li )
                    .find('span');
        }

        $percent.css( 'width', percentage * 100 + '%' );
    });

    // 文件上传成功，给item添加成功class, 用样式标记上传成功。
    uploader.on( 'uploadSuccess', function( file,response ) {
        $( '#'+file.id ).addClass('upload-state-done');
        
        if(response.errorCode == "10000"){
        	var json = eval('(' + response._raw + ')')
        	console.log(json);
        	
        	$("#imgurl").attr('img',json.data.url)
        }
    });

    // 文件上传失败，现实上传出错。
    uploader.on( 'uploadError', function( file ) {
        var $li = $( '#'+file.id ),
            $error = $li.find('div.error');

        // 避免重复创建
        if ( !$error.length ) {
            //$error = $('<div class="error"></div>').appendTo( $li );
        }

        alert('上传失败');
    });
	
    // 完成上传完了，成功或者失败，先删除进度条。
    uploader.on( 'uploadComplete', function( file ) {
    	//$( '#ceshi' ).empty()
        $( '#imgurl' ).find('.progress').remove();
        
    });
});
			$(document).ready(function(){
				//$('.text-danger').popover('show');
				/*$('.text-danger').tooltip(options)*/
				/*$('.text-danger').popover()*/
			});
		</script>
	</body>

</html>